package com.emergency.evaluate.dao;


import com.emergency.evaluate.domain.Manual;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by Administrator on 2020/3/16.
 */
public interface ManualDao extends JpaRepository<Manual,String>, JpaSpecificationExecutor<Manual> {

     //根据想定编号查询评分表
    @Query("select ma from Manual ma where scenar.id=:scenarId")
    List<Manual> findAllByScenar(@Param ( "scenarId" ) Long scenarId);
     //根据评分表ID删除评分表
     void deleteById(Long id);
     //根据评分表编号查询评分表
    @Query(value = "SELECT m FROM Manual m WHERE m.id =:id ")
    Manual findAllById(@Param("id")Long id);
    //找到与plan对应的评分表
    @Query(value = "select ma from Manual ma where ma.id=:id")
    List<Manual> findallById(@Param ("id")Long id);
}
